<template>
  <view class="page">
    <uni-nav-bar
      :title="getNavbarTitle"
      :showMenuButtonWidth="true"
      left-icon="left"
      statusBar
      backgroundColor="#fff"
      color="#333"
      :border="false"
      @clickLeft="$tools.back"
    />
    <home v-if="currentTab === 0" />
    <coupons v-if="currentTab === 1" />
    <activity v-if="currentTab === 2" />
    <order v-if="currentTab === 3" />
    <tabbar v-model="currentTab" />
  </view>
</template>
<script>
import Tabbar from "./components/Tabbar/Tabbar.vue"
import Home from "./components/Home/Home.vue"
import Coupons from "./components/Coupons/Coupons.vue"
import Activity from "./components/Activity/Activity.vue"
import Order from "./components/Order/Order.vue"
export default {
  name: "mosushop",
  components: {
    Tabbar,
    Home,
    Coupons,
    Activity,
    Order
  },
  data() {
    return {
      currentTab: 0,
      title: "雪王魔法铺"
    }
  },
  onReady() {
    this.scrollHeight =
      uni.getSystemInfo().windowHeight - 44 - uni.upx2px(250)
  },
  computed: {
    getNavbarTitle() {
      switch (this.currentTab) {
        case 0:
          return "雪王魔法铺"
        case 1:
          return "兑换享优惠"
        case 2:
          return "雪王周边"
        case 3:
          return "我的雪王币"
        default:
          return "雪王魔法铺"
      }
    }
  },
  methods: {}
}
</script>
<style lang="scss" scoped></style>
